import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        System.out.println(canJump(nums));
    }
    public static boolean canJump(int[] nums) {
        // 所以采用双循环?
        int n = nums.length;
        boolean[] dp = new boolean[n]; // 用来记录能否到第i层
        // 初始化
        dp[0] = true;
        for(int i = 1;i<n;i++){
            for(int j = i-1;j>=0;j--){
                if(i-j<=nums[j]&&dp[j]){
                    // 证明可以从第j层到第i层
                    dp[i] = true;
                    break;
                }
                dp[i] = false;
            }
        }
        return dp[n-1];
    }
}
